#!/usr/bin/env bash
# 查看cpu核心数
#phy_cpu_total=`cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l`
#查看内存		   `cat /proc/meminfo | head -1 | awk -F ":" '{print $2}' | awk '{print $1}'`
#phy_momery_total=`cat /proc/meminfo | head -1 | awk -F ":" '{print $2}' | awk '{print $1}'`
#if (phy_cpu_total < 16 || phy_momery_total<18000000) then
#	echo "当前系统物理条件不满足 8核心，16G内存以上，请查看硬件配置"
#	exit 8
#done
# 删除docler相关组件
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
# 删除docler启动服务
rm -rf /etc/systemd/system/docker.service.d
# 删除docker依赖包等
rm -rf /var/lib/docker
# 删除运行的docker的临时文件等
rm -rf /var/run/docker
# 安装依赖
yum install -y yum-utils device-mapper-persistent-data lvm2
# 下载docker镜像
# shellcheck disable=SC1068
res =`yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo`
# 安装docker 环境
yum -y install docker-ce
#启动docker
systemctl start docker



